<template>
	<view>
		<view class="my_herder">
			<view class="p-q5">
				<view class="my_h_l">
					<view class="my_h_ltx">
						<image :src="cons.avatar" style="width: 130upx;height: 130upx;"></image>
					</view>
					<view class="my_h_lsj m-l4">
						<text class="m-t3">{{cons.name}}</text>
						<text class="m-t2"><i class="iconfont icon-shouji"></i> {{cons.phone}}</text>
					</view>
				</view>
				<view class="my_h_r" @tap="tz">
					<i class="iconfont icon-qiandao m-l2"></i>
					<text class="m-l1">签到得积分</text>
				</view>
			</view>
		</view>
		<!--  -->
		<view>
			<view class="my_list">
				<view class="my_lists p-q3 f">
					<view class="my_ls_l"><i class="iconfont icon-jifen"></i><text class="m-l2">我的积分</text></view>
					<view class="my_ls_r"><text>{{cons.score}}积分</text></view>
				</view>
			</view>
			<view class="my_list">
				<view class="my_lists p-q3 f">
					<view class="my_ls_l"><i class="iconfont icon-jiangbei"></i><text class="m-l2">我的成就</text></view>
					<view class="my_ls_r">
						<!-- <text v-if="cons.role == '1'">学生</text> -->
						<text>{{cons.achievement}}</text>
					</view>
				</view>
			</view>
			<view class="my_list" v-if="cokei =='1'">
				<view class="my_lists p-q3 f">
					<view class="my_ls_l"><i class="iconfont icon-yuanxibumen"></i><text class="m-l2">院系</text></view>
					<view class="my_ls_r">
						<text>{{cons.startTime}}级别{{cons.depa}}{{cons.prof}}{{cons.clazzName}}</text>
						<!-- <uni-icons :type="iconClassList" color="rgb(179,179,179)" size="22" /> -->
					</view>
				</view>
			</view>
			<view class="my_list" >
				<navigator url="/pages/index/logo/logosj">
					<view class="my_lists p-q3 f">
						<view class="my_ls_l"><i class="iconfont icon-baogaogongdan"></i><text
								class="m-l2">修改密码</text></view>
						<uni-icons :type="iconClassList" color="rgb(179,179,179)" size="22" />
					</view>
				</navigator>
			</view>
<!-- 			<view class="my_list">
				<navigator url="./yijian">
				<view class="my_lists p-q3 f">
					<view class="my_ls_l"><i class="iconfont icon-yijianfankui"></i><text class="m-l2">意见报告</text>
					</view>
					<uni-icons :type="iconClassList" color="rgb(179,179,179)" size="22" />
				</view>
				</navigator>
			</view> -->
			<view class="my_list">
				<navigator url="../index/logo/zhengce">
				<view class="my_lists p-q3 f">
					<view class="my_ls_l"><image src="../../static/zhengce.png" style="width: 34upx;height: 34upx;vertical-align: middle;" /><text class="m-l2">隐私政策</text></view>
						<uni-icons :type="iconClassList" color="rgb(179,179,179)" size="22" />
				</view>
				</navigator>
			</view>
			<view class="my_list">
				<navigator url="../index/logo/xieyi">
				<view class="my_lists p-q3 f">
					<view class="my_ls_l"><image src="../../static/xieyi.png" style="width: 34upx;height: 34upx;vertical-align: middle;" /><text class="m-l2">用户协议</text></view>
						<uni-icons :type="iconClassList" color="rgb(179,179,179)" size="22" />
				</view>
				</navigator>
			</view>
			<view class="my_list">
				<navigator url="./bangzhu">
				<view class="my_lists p-q3 f">
					<view class="my_ls_l"><i class="iconfont icon-bangzhu"></i><text class="m-l2">帮助中心</text></view>
						<uni-icons :type="iconClassList" color="rgb(179,179,179)" size="22" />
				</view>
				</navigator>
			</view>
		</view>
	</view>
</template>

<script>
	// import {
	// 	mapState,
	// 	mapMutations,
	// 	forcedLogin
	// } from 'vuex'
	export default {
		// computed: mapState(['hasLogin', 'uerInfo']),
		data() {
			return {
				iconClassList: 'arrowright',
				cons: [],
				cokei: ''
			}
		},
		onShow() {
			this.shua()
			this.token = uni.getStorageSync('token')
			if(this.token == ''){
				uni.reLaunch({
					url:'/pages/index/logo/logo'
				})
			}else{
				uni.navigateTo({
					url:'/pages/my/index'
				});
			}
		},
		created() {

		},
		onNavigationBarButtonTap(e) {
			uni.navigateTo({
				url: './shezhi'
			})
		},
		methods: {
			shua() {
				this.cokei = uni.getStorageSync('cokei')
				// uni.showLoading({
				// 	title: '正在加载',
				// 	mask: false
				// });
				let that = this
				that.pyReq(that.$http.getMyInfo,{},function(res){
						  that.cons = res.result
				});
				// let headers = {
				// 	'content-type': 'application/x-www-form-urlencoded',
				// 	'token': uni.getStorageSync('token')
				// }
				// uni.request({
				// 	url: that.$http.getMyInfo,
				// 	method: 'POST',
				// 	header: headers,
				// 	success: (res) => {
				// 		console.log(res)
				// 		if(res.data.code == '1001'){
				// 			uni.clearStorageSync();
				// 		  uni.showModal({
				// 		      title: '提示',
				// 		      content: res.data.msg,
				// 		      success: function (res) {
				// 		          if (res.confirm) {
				// 		             uni.reLaunch({
				// 		             	url:'/pages/index/logo/logo'
				// 		             })
				// 		          } else if (res.cancel) {
				// 		              console.log('用户点击取消');
				// 		          }
				// 		      }
				// 		  });
				// 		}else{
				// 			that.cons = res.data.result
				// 		}
				// 		uni.hideLoading();
				// 	},
				// 	fail: (err) => {
				// 		console.log(err)
				// 	}
				// })
			},
			tz() {
				var id = this.cons.avatar
				console.log(id)
				uni.navigateTo({
					url: './qiandao?id='+id
				})
			}
		}
	}
</script>

<style>
	.my_lists {
		justify-content: space-between;
	}

	.my_list {
		border-bottom: 1upx solid #B2B2B2;
	}

	.my_ls_l {}

	.my_ls_r {}

	.my_h_r {
		position: absolute;
		right: -34upx;
		top: 72upx;
		width: 260upx;
		/* height: 40upx; */
		background-color: #FFFFFF;
		color: #B31610;
		border-radius: 50upx;
		font-size: 26upx;
	}

	.my_herder {
		background-color: #B31610;
		padding-bottom: 20upx;
		overflow: hidden;
	}

	.p-q5 {
		position: relative;
		overflow: hidden;
	}

	.my_h_l {
		display: flex;
	}

	.my_h_ltx {
		float: left;
		width: 130upx;
		height: 130upx;
		border-radius: 50%;
		overflow: hidden;
		background-color: #FFF;
	}

	.my_h_ltx image {
		width: 130upx;
		height: 130upx;
	}

	.my_h_lsj {
		float: left;
	}

	.my_h_lsj text {
		display: block;
		color: #FFFFFF;
	}
</style>
